import React from 'react'
import styles from './index.css';
import List from '../component/list/list'
import { Button } from 'antd';
import '../../flex';
export default class extends React.Component {
  constructor(props) {
    super(props);
    this.changeiframeSrc = this.changeiframeSrc.bind(this);
    this.state = {
      iframePage: {
        "name": "纸要省钱",
        "classify": "product",
        "pageUrl": "activity1/index.html",
        "remarks": "",
        "note": ""
      }
    }
  }

  changeiframeSrc(page) {
    console.log('传输成功', page)
    this.setState({
      iframePage: page
    })
  }
  render() {
    return (
      <div className={styles.normal}>
        <div className="navMenu">
          <div className="navList"><List subInfo={this.changeiframeSrc} /></div>
          <div style={{ margin: '10px' }}>
            <Button
              onClick={() => window.open('http://mobile.unilifemedia.com/uweb/html/' + this.state.iframePage.pageUrl)}>
              进入"{this.state.iframePage.name}"
            </Button>
          </div>
          <iframe
            title={this.state.iframePage.name}
            src={'http://mobile.unilifemedia.com/uweb/html/' + this.state.iframePage.pageUrl}
            frameBorder="0"
            className="navIframe">
          </iframe>
        </div>
        <iframe title="advert" className={styles.advert} src="https://www.baidu.com/" frameborder="0"></iframe>
      </div>
    );
  }
}
